package nbcp.client

import nbcp.interfaces.DemoService
import org.apache.dubbo.config.annotation.Service
import org.apache.dubbo.rpc.RpcContext
import org.slf4j.Logger
import org.slf4j.LoggerFactory



@Service
class DemoServiceImpl : DemoService {

    override fun sayHello(name: String): String {
        logger.info("Hello " + name + ", request from consumer: " + RpcContext.getContext().remoteAddress)
        return "Hello " + name + ", response from provider: " + RpcContext.getContext().localAddress
    }

    companion object {
        private val logger = LoggerFactory.getLogger(DemoServiceImpl::class.java)
    }

}
